const Font = require('fonteditor-core').Font;
const fs = require('fs');
let buffer = fs.readFileSync('./font.ttf');

const font = Font.create(buffer);
let fontObject = font.get();
console.log(Object.keys(fontObject));
const text = [];
fontObject.glyf.forEach(glyph => {
    if (!glyph.unicode || !glyph.unicode[0]) return;
    text.push(String.fromCharCode(glyph.unicode[0]))
})
fs.writeFileSync('./output.txt', text.join(""), 'utf-8');